package com.ww.springboot.rabbitmq.listener;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ShutdownSignalException;
import org.springframework.amqp.rabbit.connection.ChannelListener;
import org.springframework.stereotype.Component;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2023-02-16 16:37
 */
@Component
public class MyChannelListener implements ChannelListener {

    @Override
    public void onCreate(Channel channel, boolean transactional) {
        System.out.println("------------onCreate------------");
        System.out.println(channel);
        System.out.println(transactional);
    }

    @Override
    public void onShutDown(ShutdownSignalException signal) {
        System.out.println("------------onShutDown------------");
        System.out.println(signal);
    }
}
